<div id="vista">
<div id="titulo">Confirmar pedido</div>
<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
  
    <label for="frmCod"></label>
	<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
	  <tr>
		<td><div class="controls">
		    <input type="text" name="rut_persona" id="rut_persona" onkeyup="validar(this.value);">
    <select name="PedRut" id="PedRut">
      <option value="0">Rut</option>
      <option value="1">N&uacute;mero Pedido</option>
    </select>
    <input name="estado" type="hidden" id="estado" value="1">
  </div>
  <input type="submit" name="Submit" value="Ingresar">
  <input type="hidden" name="MM_insert" value="form1">
  
		</td>
	  </tr>
	</table>

</form>
<?php
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
	
	 if ($totalRows_rsVs_material>0){
	?>
	<form id="form2" name="form2" method="post" action="<?php echo $editFormAction; ?>" onsubmit="return false">
	<table width="90%"  border="0" align="center" cellpadding="2" cellspacing="2">
	  <tr>
		<td width="12%">Fecha</td>
		<td width="22%">Colecci&oacute;n</td>
		<td width="12%">Area</td>
		<td width="36%">T&iacute;tulo</td>
		<td width="10%">Portada</td>
		<td width="8%">Confirmar</td>  
	  </tr>
	  <?php
	  while (!$rsVs_material->EOF) {
	?>
		<tr>
		  <td><?php echo fechaPrestamo(); ?></td>
	      <td><?php echo $rsVs_material->Fields('nombre_coleccion'); ?>
          </td>
		  <td><?php echo $rsVs_material->Fields('describe_area'); ?></td>
		   <td><a href="#" onclick="showModal(<?php echo $rsVs_material->Fields('id_material')?>)"><?php echo $rsVs_material->Fields('titulo'); ?></a></td>
		  <td><img src="imagenes/caratulas/<?php echo $rsVs_material->Fields('portada'); ?>" alt="portada" name="portada" width="50" height="65" id="portada"></td>
		  <td><input type="checkbox" name="chbDetalle[]" value="<?php echo $rsVs_material->Fields('id_detalle_prestamo')?>"></td>
		</tr>
		<?php
		$rsVs_material->MoveNext(); 
	  }
	?>
	</table>
	<input name="mm_insert2" type="hidden" id="mm_insert2" value="form2">
	<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
      <tr>
        <td><input name="Confirmar" type="submit" id="Confirmar" value="Confirmar" onclick="confirmarReservas()" /></td>
      </tr>
    </table>
	</form>
		<?php
	} else {
		echo "<b>No existen Registros</b>";
	}
}
if ((isset($_POST["mm_insert2"])) && ($_POST["mm_insert2"] == "form2")) {

?>

	    <table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
          <tr>
            <td>Libros Entregados</td>
          </tr>
        </table>
        <table width="90%"  border="0" align="center" cellpadding="2" cellspacing="2">
	  <tr>
		<td width="13%">Fecha</td>
		<td width="41%">Nombre colecci&oacute;n</td>
		<td width="17%">Area</td>
		<td width="17%">T&iacute;tulo</td>
		<td width="12%">Portada</td>		
	  </tr>
	  <?php
	  while (!$rsMaterial->EOF) {
	?>
		<tr>
		  <td><?php echo $rsMaterial->Fields('fecha_entrega'); ?></td>
	      <td><?php echo $rsMaterial->Fields('nombre_coleccion'); ?></td>
		  <td><?php echo $rsMaterial->Fields('describe_area'); ?></td>
		  <td><a href="#" onclick="showModal(<?php echo $rsMaterial->Fields('id_material')?>)"><?php echo $rsMaterial->Fields('titulo'); ?></a></td>
		  <td><img src="imagenes/caratulas/<?php echo $rsMaterial->Fields('portada'); ?>" alt="portada" name="portada" width="50" height="65" id="portada" /></td>
		</tr>
		<?php
		$rsMaterial->MoveNext(); 
	  }
	?>
  </table>



<?php
	exit();
}


if (isset($rsVs_material)){
	$rsVs_material->Close();
}

if (isset($rsMaterial)){
	$rsMaterial->Close();
}
?>
</div>